![]() |
Kinetis SDK API Reference Manual
1.0.0-beta
Freescale Semiconductor, Inc.
|
The section describes the programming interface of the ENET RTCS Adaptor. More...
Data Structures | |
| struct | ENET_HEADER_PTR |
| Define Structure for Ethernet packet header. More... | |
| struct | PCB_FRAGMENT_PTR |
| Define Structure that contains fragment of PCB. More... | |
| struct | PCB_PTR |
| Define PCB structure for RTCS adaptor. More... | |
| struct | PCB2_PTR |
| Define PCB structure contains two fragments. More... | |
| struct | pcb_queue |
| Define PCB structure contains two fragments. More... | |
| struct | ENET_ECB_STRUCT_PTR |
| Define ECB structure contains protocol type and it's related service function. More... | |
| struct | enet_8022_header_ptr |
| Define 8022 header. More... | |
| struct | ENET_COMMON_STATS_STRUCT_PTR |
| Define common status structure. More... | |
| struct | ENET_STATS_PTR |
Macros | |
| #define | ENET_RECEIVE_TASK_PRIO (_RTCSTASK_priority + 2) |
| #define | ENET_TASK_STACK_SIZE (800) |
| #define | ENET_PCB_NUM (16) |
| #define | ENET_RX_RING_LEN (8) |
| Define parameter for configuration. | |
| #define | ENET_TX_RING_LEN (4) |
| #define | ENET_RX_LARGE_BUFFER_NUM (0) |
| #define | ENET_RX_BUFFER_ALIGNMENT (16) |
| #define | ENET_TX_BUFFER_ALIGNMENT (16) |
| #define | ENET_BD_ALIGNMENT (16) |
| #define | ENET_MII_CLOCK (2500000L) |
| #define | ENET_OK (0) |
| #define | ENET_ERROR (0xff) /* General ENET error */ |
| #define | ENETERR_INVALID_DEVICE (kStatus_ENET_InvalidDevice) /* Device number out of range */ |
| #define | ENETERR_INIT_DEVICE (kStatus_ENET_Initialized) /* Device already initialized */ |
| #define | ENETPROT_IP 0x0800 |
| Define ENET protocol parameter. | |
| #define | ENETPROT_ARP 0x0806 |
| #define | ENETPROT_8021Q 0x8100 |
| #define | ENETPROT_IP6 0x86DD |
| #define | ENETPROT_ETHERNET 0x88F7 |
| #define | ENET_OPT_8023 0x0001 |
| #define | ENET_OPT_8021QTAG 0x0002 |
| #define | ENET_SETOPT_8021QPRIO(p) (ENET_OPT_8021QTAG | (((uint_32)(p) & 0x7) << 2)) |
| #define | ENET_GETOPT_8021QPRIO(f) ((((unsigned int)f) >> 2) & 0x7) |
| #define | ENET_OPTION_HW_TX_IP_CHECKSUM 0x00001000 |
| Define ENET option macro. | |
| #define | ENET_OPTION_HW_TX_PROTOCOL_CHECKSUM 0x00002000 |
| #define | ENET_OPTION_HW_RX_IP_CHECKSUM 0x00004000 |
| #define | ENET_OPTION_HW_RX_PROTOCOL_CHECKSUM 0x00008000 |
| #define | ENET_OPTION_HW_RX_MAC_ERR 0x00010000 |
| #define | ENET_DEFAULT_MAC_ADD { 0x00, 0x00, 0x5E, 0, 0, 0 } |
| Define for ENET default MAC. | |
| #define | PCB_MINIMUM_SIZE (sizeof(PCB2)) |
| #define | PCB_free(pcb_ptr) ((pcb_ptr)->FREE(pcb_ptr)) |
| #define | htonl(p, x) |
| Define macro for byte-swap. More... | |
| #define | htons(p, x) |
| #define | htonc(p, x) |
| #define | ntohl(p) |
| #define | ntohs(p) |
| #define | ntohc(p) ((uint_8)(((uint_8_ptr)(p))[0])) |
| #define | htone(p, x) |
| #define | ntohe(p, x) |
| #define | QUEUEADD(head, tail, pcb) |
| Define add to queue. More... | |
| #define | QUEUEGET(head, tail, pcb) |
| Define get from queue. More... | |
Typedefs | |
| typedef void * | task_param_t |
| Define Error codes. | |
| typedef unsigned char | _enet_address [6] |
| Define for ENET six-byte MAC type. | |
| typedef void * | _enet_handle |
| Define the structure for ipcfg. | |
| typedef void(* | PCB_FREE_FPTR )(struct pcb *) |
Variables | |
| unsigned long | _RTCSTASK_priority |
| Define Task parameter. | |
ENET RTCS ADAPTOR | |
| uint32_t | ENET_initialize (uint32_t device, _enet_address address, uint32_t flag, _enet_handle *handle) |
| Initialize the ENET device. More... | |
| uint32_t | ENET_open (_enet_handle handle, uint16_t type, void(*service)(PCB_PTR, void *), void *private) |
| Open the ENET device. More... | |
| uint32_t | ENET_shutdown (_enet_handle handle) |
| Shutdown the ENET device. More... | |
| static void | ENET_receive (task_param_t param) |
| ENET frame receive. More... | |
| uint32_t | ENET_send (_enet_handle handle, PCB_PTR packet, uint32_t type, _enet_address dest, uint32_t flags) |
| ENET frame transmit. More... | |
| uint32_t | ENET_get_address (_enet_handle handle, _enet_address address) |
| ENET get address with initialized device. More... | |
| uint32_t | ENET_get_mac_address (uint32_t device, uint32_t value, _enet_address address) |
| ENET get address with uninitialized device. More... | |
| uint32_t | ENET_join (_enet_handle handle, uint16_t type, _enet_address address) |
| ENET join a multicast group address. More... | |
| uint32_t | ENET_leave (_enet_handle handle, uint16_t type, _enet_address address) |
| ENET leave a multicast group address. More... | |
| bool | ENET_link_status (_enet_handle handle) |
| ENET get link status. More... | |
| uint32_t | ENET_get_speed (_enet_handle handle) |
| ENET get link speed. More... | |
| uint32_t | ENET_get_MTU (_enet_handle handle) |
| ENET get MTU. More... | |
| bool | ENET_phy_registers (_enet_handle handle, uint32_t numRegs, uint32_t *regPtr) |
| Get ENET PHY registers. More... | |
| uint32_t | ENET_get_options (_enet_handle handle) |
| Get ENET options. More... | |
| uint32_t | ENET_close (_enet_handle handle, uint16_t type) |
| Unregisters a protocol type on an Ethernet channel. More... | |
| uint32_t | ENET_mediactl (_enet_handle handle, uint32_t commandId, void *inOutParam) |
| ENET mediactl . More... | |
| _enet_handle | ENET_get_next_device_handle (_enet_handle handle) |
| Get the next ENET device handle address. More... | |
| void | ENET_free (PCB_PTR packet) |
| ENET free . More... | |
| const char * | ENET_strerror (uint32_t error) |
| ENET error description. More... | |
| struct ENET_HEADER |
Data Fields | |
| _enet_address | DEST |
| destination MAC address | |
| _enet_address | SOURCE |
| source MAC address | |
| unsigned char | TYPE [2] |
| protocol type | |
| struct PCB_FRAGMENT |
| struct PCB |
| struct PCB2 |
| struct ENET_ECB_STRUCT |
| struct enet_8022_header_t |
| struct ENET_COMMON_STATS_STRUCT |
Data Fields | |
| uint32_t | ST_RX_TOTAL |
| Total number of received packets. | |
| uint32_t | ST_RX_MISSED |
| Number of missed packets. | |
| uint32_t | ST_RX_DISCARDED |
| Discarded unrecognized protocol. | |
| uint32_t | ST_RX_ERRORS |
| Discarded error during reception. | |
| uint32_t | ST_TX_TOTAL |
| Total number of transmitted packets. | |
| uint32_t | ST_TX_MISSED |
| Discarded transmit ring full. | |
| uint32_t | ST_TX_DISCARDED |
| Discarded bad packet. | |
| uint32_t | ST_TX_ERRORS |
| Error during transmission. | |
| struct ENET_STATS |
Data Fields | |
| ENET_COMMON_STATS_STRUCT | COMMON |
| Common status structure. | |
| uint32_t | ST_RX_ALIGN |
| Frame Alignment error. | |
| uint32_t | ST_RX_FCS |
| CRC error. | |
| uint32_t | ST_RX_RUNT |
| Runt packet received. | |
| uint32_t | ST_RX_GIANT |
| Giant packet received. | |
| uint32_t | ST_RX_LATECOLL |
| Late collision. | |
| uint32_t | ST_RX_OVERRUN |
| DMA overrun. | |
| uint32_t | ST_TX_SQE |
| Heartbeat lost. | |
| uint32_t | ST_TX_DEFERRED |
| Transmission deferred. | |
| uint32_t | ST_TX_LATECOLL |
| Late collision. | |
| uint32_t | ST_TX_EXCESSCOLL |
| Excessive collisions. | |
| uint32_t | ST_TX_CARRIER |
| Carrier sense lost. | |
| uint32_t | ST_TX_UNDERRUN |
| DMA underrun. | |
| uint32_t | ST_RX_COPY_SMALL |
| Driver had to copy packet. | |
| uint32_t | ST_RX_COPY_LARGE |
| Driver had to copy packet. | |
| uint32_t | ST_TX_COPY_SMALL |
| Driver had to copy packet. | |
| uint32_t | ST_TX_COPY_LARGE |
| Driver had to copy packet. | |
| uint32_t | RX_FRAGS_EXCEEDED |
| uint32_t | RX_PCBS_EXHAUSTED |
| uint32_t | RX_LARGE_BUFFERS_EXHAUSTED |
| uint32_t | TX_ALIGNED |
| uint32_t | TX_ALL_ALIGNED |
| #define htonl | ( | p, | |
| x | |||
| ) |
| #define htons | ( | p, | |
| x | |||
| ) |
| #define htonc | ( | p, | |
| x | |||
| ) |
| #define ntohl | ( | p | ) |
| #define ntohs | ( | p | ) |
| #define htone | ( | p, | |
| x | |||
| ) |
| #define ntohe | ( | p, | |
| x | |||
| ) |
| #define QUEUEADD | ( | head, | |
| tail, | |||
| pcb | |||
| ) |
| #define QUEUEGET | ( | head, | |
| tail, | |||
| pcb | |||
| ) |
| uint32_t ENET_initialize | ( | uint32_t | device, |
| _enet_address | address, | ||
| uint32_t | flag, | ||
| _enet_handle * | handle | ||
| ) |
| device | The ENET device number. |
| address | The hardware address. |
| flag | The flag for upper layer. |
| handle | The address pointer for ENET device structure. |
| uint32_t ENET_open | ( | _enet_handle | handle, |
| uint16_t | type, | ||
| void(*)(PCB_PTR, void *) | service, | ||
| void * | private | ||
| ) |
| handle | The address pointer for ENET device structure. |
| type | The ENET protocol type. |
| service | The service function for type. |
| private | The private data for ENET device. |
| uint32_t ENET_shutdown | ( | _enet_handle | handle | ) |
| handle | The address pointer for ENET device structure. |
|
static |
| enetIfPtr | The address pointer for ENET device structure. |
| uint32_t ENET_send | ( | _enet_handle | handle, |
| PCB_PTR | packet, | ||
| uint32_t | type, | ||
| _enet_address | dest, | ||
| uint32_t | flags | ||
| ) |
| handle | The address pointer for ENET device structure. |
| packet | The ENET packet buffer. |
| type | The ENET protocol type. |
| dest | The destination hardware address. |
| flag | The flag for upper layer. |
| uint32_t ENET_get_address | ( | _enet_handle | handle, |
| _enet_address | address | ||
| ) |
| handle | The address pointer for ENET device structure. |
| address | The destination hardware address. |
| uint32_t ENET_get_mac_address | ( | uint32_t | device, |
| uint32_t | value, | ||
| _enet_address | address | ||
| ) |
| handle | The address pointer for ENET device structure. |
| value | The value to change the last three bytes of hardware. |
| address | The destination hardware address. |
| uint32_t ENET_join | ( | _enet_handle | handle, |
| uint16_t | type, | ||
| _enet_address | address | ||
| ) |
| handle | The address pointer for ENET device structure. |
| type | The ENET protocol type. |
| address | The destination hardware address. |
| uint32_t ENET_leave | ( | _enet_handle | handle, |
| uint16_t | type, | ||
| _enet_address | address | ||
| ) |
| handle | The address pointer for ENET device structure. |
| type | The ENET protocol type. |
| address | The destination hardware address. |
| bool ENET_link_status | ( | _enet_handle | handle | ) |
| handle | The address pointer for ENET device structure. |
| uint32_t ENET_get_speed | ( | _enet_handle | handle | ) |
| handle | The address pointer for ENET device structure. |
| uint32_t ENET_get_MTU | ( | _enet_handle | handle | ) |
| handle | The address pointer for ENET device structure. |
| bool ENET_phy_registers | ( | _enet_handle | handle, |
| uint32_t | numRegs, | ||
| uint32_t * | regPtr | ||
| ) |
| handle | The address pointer for ENET device structure. |
| numRegs | The number of registers. |
| regPtr | The buffer for data read from PHY registers. |
| uint32_t ENET_get_options | ( | _enet_handle | handle | ) |
| handle | The address pointer for ENET device structure. |
| uint32_t ENET_close | ( | _enet_handle | handle, |
| uint16_t | type | ||
| ) |
| handle | The address pointer for ENET device structure. |
| uint32_t ENET_mediactl | ( | _enet_handle | handle, |
| uint32_t | commandId, | ||
| void * | inOutParam | ||
| ) |
| handle | The address pointer for ENET device structure. |
| The | command Id. |
| The | buffer for input or output parameters. |
| _enet_handle ENET_get_next_device_handle | ( | _enet_handle | handle | ) |
| handle | The address pointer for ENET device structure. |
| void ENET_free | ( | PCB_PTR | packet | ) |
| packet | The buffer address. |
| const char* ENET_strerror | ( | uint32_t | error | ) |
| error | The ENET error code. |